package com.blb.zycommunity.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.blb.zycommunity.entity.ZyOwner;
import com.blb.zycommunity.entity.ZyOwnerRoom;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 * 房屋绑定表  Mapper 接口
 * </p>
 *
 * @author chenheng
 * @since 2023-11-20
 */
public interface ZyOwnerRoomMapper extends BaseMapper<ZyOwnerRoom> {

    @Delete("delete from zy_owner_room where owner_id = #{ownerId} and room_id = #{roomId}")
    void deleteZyOwnerRoom(String ownerId,String roomId);

    List<ZyOwnerRoom> selectAllList();
    //审核通过
    @Update("update zy_owner_room set room_status = '1' where owner_room_id = #{ownerRoomId}  ")
    void updatePass(String ownerRoomId);

    //审核不通过
    @Update("update zy_owner_room set room_status = '2' where owner_room_id = #{ownerRoomId}  ")
    void updateNotPass(String ownerRoomId);

    IPage<ZyOwnerRoom> selectOwnerReviewPage(IPage<ZyOwnerRoom> page, String communityId, String roomStatus);

    List<ZyOwnerRoom> selectByOwnerIdZyOwnerRooms(String ownerId);
}
